from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.urls import path, include
from social.routing import websocket_urlpatterns  # 直接导入 websocket_urlpatterns

application = ProtocolTypeRouter({
    "websocket": AuthMiddlewareStack(
        URLRouter([
            path("", include(websocket_urlpatterns)),
            # 或者直接包含，不需要 path 和 include：
            # websocket_urlpatterns
        ])
    ),
})